

function checkForm() {
    var flag1=CheckIsNull("account");
    var flag2 = CheckIsNull("password");

    return flag1&&flag2;

}


//通用校验是否为空
function CheckIsNull(id) {
    var node = document.getElementById("input"+id);
    var nodeDiv=document.getElementById(id+"Div");
    var nodeLabel=document.getElementById(id+"Label2");


    var reg=/^\s*$/;//符合正则返回true

    if(reg.test(node.value)){
        nodeLabel.innerHTML="不能为空"
        nodeDiv.className+=" has-error"
        return false;
    }else {
        nodeLabel.innerHTML="";
        nodeDiv.className="form-group";
        return true;
    }
}
